/*
 * @Description: 基础设置接口
 * @version: 电子名片2.0
 * @Author: 付小清
 * @Date: 2020-11-20 14:20:32
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-11-18 10:56:48
 */

import request from '@/utils/request'

// 假接口
export function userSet(query) {
  return request({
    url: '/vue-element-admin/article/list',
    method: 'get',
    params: query
  })
}

// =======================公共设置=======================

// 获取公共设置
export function getCommonConfig(query) {
  return request({
    url: `/sys/platform/setting/member/${query.id}`,
    method: 'get',
    params: query
  })
}

// 更新公共设置
export function updateCommonConfig(query, config) {
  return request({
    url: '/sys/platform/setting/member',
    method: 'post',
    data: query,
    ...config
  })
}

// 上传文件
export function fileUpload(query) {
  return request({
    url: `/oss/file-anon/upload`,
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data: query
  })
}

// =======================举报列表=======================

// 举报列表
export function reportList(query) {
  return request({
    url: `/sys/platform/setting/member/report/${query.type}`,
    method: 'get',
    params: query
  })
}

// 编辑和添加举报项
export function reportUpdate(query) {
  return request({
    url: `/sys/platform/setting/member/report/${query.type}`,
    method: 'post',
    data: query
  })
}

// 删除举报
export function reportDelete(query) {
  return request({
    url: `/sys/platform/setting/member/report/${query.id}`,
    method: 'delete'
  })
}

// =======================协议管理=======================

// 获取协议
export function getAgreement(query) {
  return request({
    url: '/sys/platform/setting/universal/agreement',
    method: 'get',
    params: query
  })
}
// 更新协议
export function updateAgreement(query) {
  return request({
    url: '/sys/platform/setting/universal/agreement',
    method: 'post',
    data: query
  })
}

// =======================行政区域管理=======================

// 行政区域目录树
export function areaTree(query) {
  return request({
    url: '/sys/platform/setting/universal/area',
    method: 'get',
    params: query
  })
}

// 添加编辑行业
export function areaUpdateEdit(query) {
  return request({
    url: '/sys/platform/setting/universal/area',
    method: 'post',
    data: query
  })
}

// 查询行政区域列表
export function areaList(query) {
  return request({
    url: '/sys/platform/setting/universal/area/child',
    method: 'get',
    params: query
  })
}

// 删除行政区域
export function areaDelete(query) {
  return request({
    url: `/sys/platform/setting/universal/area/${query.id}`,
    method: 'delete'
    // params: query
  })
}

// =======================行业管理=======================

// 行业树形图
export function industryTree(query) {
  return request({
    url: `/sys/platform/setting/universal/industry`,
    method: 'get',
    params: query
  })
}

// 添加编辑行业
export function industryUpdateEdit(query) {
  return request({
    url: `/sys/platform/setting/universal/industry`,
    method: 'post',
    data: query
  })
}

// 查询行业列表
export function industryList(query) {
  return request({
    url: `/sys/platform/setting/universal/industry/child`,
    method: 'get',
    params: query
  })
}

// 删除行业
export function industryDelete(query) {
  return request({
    url: `/sys/platform/setting/universal/industry/${query.id}`,
    method: 'delete'
  })
}

// =======================职位管理=======================

// 职位列表
export function positionList(query) {
  return request({
    url: `/sys/platform/setting/universal/position`,
    method: 'get',
    params: query
  })
}

// 添加编辑职位
export function positionUpdateEdit(query) {
  return request({
    url: `/sys/platform/setting/universal/position`,
    method: 'post',
    data: query
  })
}

// 删除职位
export function positionDelete(query) {
  return request({
    url: `/sys/platform/setting/universal/position/${query.id}`,
    method: 'delete'
    // data: query
  })
}

// =======================敏感词库=======================

// 敏感词库列表
export function sensitiveList(query) {
  return request({
    url: `/sys/platform/setting/universal/sensitive`,
    method: 'get',
    params: query
  })
}

// 添加编辑敏感词库
export function sensitiveUpdateEdit(query) {
  return request({
    url: `/sys/platform/setting/universal/sensitive`,
    method: 'post',
    data: query
  })
}

// 删除敏感词库
export function sensitiveDelete(query) {
  return request({
    url: `/sys/platform/setting/universal/sensitive/${query.id}`,
    method: 'delete'
    // data: query
  })
}

// =======================标签=======================

// 标签树形图
export function tagTree(query) {
  return request({
    url: `/sys/platform/setting/company/tag`,
    method: 'get',
    params: query
  })
}

// 添加编辑标签
export function tagUpdateEdit(query) {
  return request({
    url: `/sys/platform/setting/company/tag`,
    method: 'post',
    data: query
  })
}

// 查询标签列表
export function tagList(query) {
  return request({
    url: `/sys/platform/setting/company/tag/child`,
    method: 'get',
    params: query
  })
}

// 删除标签
export function tagDelete(query) {
  return request({
    url: `/sys/platform/setting/company/tag/${query.id}`,
    method: 'delete'
  })
}

// =======================短信通道设置=======================
// 短信配置列表
export function smsConfig() {
  return request({
    url: `/notify/platform/conf/sms/template`,
    method: 'get'
  })
}

export function editSmsConfig(params) {
  return request({
    url: `/notify/platform/conf/sms/template`,
    method: 'post',
    data: params
  })
}

// =======================节假日设置================================
// 节假日列表
export function  festivalsList(query){
  return request({
    url: '/circle/platform/festivalset/page',
    method: 'get',
    params: query
  })
}
// 节假日设置 - 新增和编辑
export function  setFestivals(params){
  return request({
    url: '/circle/platform/festivalset/su',
    method: 'post',
    data: params
  })
}
// 节假日设置 - 删除
export function delFestivals(query){
  return request({
    url: `/circle/platform/festivalset/${query.id}`,
    method: 'DELETE',
  })
}
// 节假日设置 - 可选下拉数据
export function festivalPullList(query){
  return request({
    url: `/circle/platform/festivalset/sel`,
    method: 'get',
    params: query
  })
}

// =======================版本号设置================================
export function versionAll(query) {
  return request({
    url: '/sys/platform/setting/app/version/all',
    method: 'get',
    params: query
  })
}
export function versionDetail(id) {
  return request({
    url: `/sys/platform/setting/app/version/detail/${id}`,
    method: 'get',
    params: {}
  })
}

export function versioEdit(params) {
  return request({
    url: `/sys/platform/setting/app/version/edit`,
    method: 'post',
    data: params
  })
}
export function versioDel(id) {
  return request({
    url: `/sys/platform/setting/app/version/del/${id}`,
    method: 'delete',
    params: {}
  })
}

// ======================= 短信平台设置 ================================
export function platformAll(query) {
  return request({
    url: '/notify/platform/conf/sms/platform/all',
    method: 'get',
    params: query
  })
}
export function platformDel(id) {
  return request({
    url: `/notify/platform/conf/sms/platform/del/${id}`,
    method: 'delete',
    params: {}
  })
}

export function platformDetail(id) {
  return request({
    url: `/notify/platform/conf/sms/platform/detail/${id}`,
    method: 'get',
    params: {}
  })
}

export function platformEdit(params) {
  return request({
    url: `/notify/platform/conf/sms/platform/edit`,
    method: 'post',
    data: params
  })
}
// ======================= 短信模板设置 ================================
export function templateAll(query) {
  return request({
    url: '/notify/platform/conf/sms/template/all',
    method: 'get',
    params: query
  })
}
export function templateDel(id) {
  return request({
    url: `/notify/platform/conf/sms/template/del/${id}`,
    method: 'delete',
    params: {}
  })
}

export function templateDetail(id) {
  return request({
    url: `/notify/platform/conf/sms/template/detail/${id}`,
    method: 'get',
    params: {}
  })
}

export function templateEdit(params) {
  return request({
    url: `/notify/platform/conf/sms/template/edit`,
    method: 'post',
    data: params
  })
}

export function templateUpdate() {
  return request({
    url: '/notify/platform/conf/sms/template/audit/update',
    method: 'get',
    params: {}
  })
}

export function templateSel(params) {
  return request({
    url: '/notify/platform/conf/sms/platform/sel',
    method: 'get',
    params: params
  })
}




